<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>导航管理</title>
<link rel="stylesheet" href="${base!}/css/navigation/main.css" />
<script type="text/javascript" src="${base!}/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="${base}/js/lhgdialog/lhgdialog.min.js"></script>
<script language="javascript">
var stillCount='${stillNum!}';
$(document).ready(function(){
	if(stillCount>0){
		$.dialog({
		    id: 'msg',
		    title: '友情提示',
		    time: 5,
		    content: "本站点需要"+${total}+"个导航位置,现在有"+${nowNum}+"个位置,还差"+${stillNum}+"个位置,请补完！",
		    width: 200,
		    height: 100,
		    left: '100%',
		    top: '100%',
		    fixed: true,
		    drag: false,
		    resize: false
		});
	}
});
function goEdit(priority){
	window.location.href="/channel/admin/editPriority.htm?priority="+priority;
};
/*
 * 删除指定的导航条栏目
 */
function goDelete(originalPriority,channelId){
	if(channelId!=null && channelId>0){
		$.ajax({
			type: 'POST',
			dataType : "json",
			url: "/channel/deleteForNavigation.jhtml?originalPriority="+originalPriority,
			error: function () {//请求失败处理函数
				$.dialog.alert("请求失败!");
			},
			success:function(data){ //请求成功后处理函数。 
				if(data=="SUCCESS"){
					 myAlert("重置成功!");
				}else{
					$.dialog.alert("重置失败，导航条信息丢失!");
				}
			}
		});
	}else{
		return false;
	}
};
/*
 * 重置导航条后的提示信息
 */
function myAlert(txt){
	$.dialog({
		lock: true,
		content: txt,
		width: '100px',
	    height: 100,
		cancelVal: '确定',
		autoSize:true,
	    cancel: function(){ //请求成功后处理函数。
	    	window.location.href="/channel/navigationList.jhtml";
		}
	});
}
</script>
</head>

<body>
<div class="w100" id="right_c">
<form id="tableForm" name="tableForm"  method="post"  action="savepriority.jhtml">
<table border="0" cellspacing="1" cellpadding="0" class="taball" style="margin-top:5px;">
  <tr  align="center">
    <th width="10%">所属导航位置</th>
    <th width="15%">栏目名称</th>
    <th width="15%" style="display:none">栏目ID</th>
	<th width="15%" style="display:none">是否开启</th>
    <th width="15%">操作</th>
  </tr>
  <#list navigationMap?keys as nMap>
  <tr>
    <td align="center" valign="middle">&nbsp;&nbsp;位置&nbsp;${nMap}&nbsp;</td>
    <td id="channel_name" align="center" valign="middle">
    	<#list navigationList as nConfig>
    		<#if nMap == nConfig.priority >
    			${(nConfig.channelName)!}&nbsp;
    		</#if>
    	</#list>	
    </td>
    <td id="channel_id" style="display:none">
   		 <#list navigationList as nConfig>
    		<#if nMap == nConfig.priority >
    			${(nConfig.channelId)!}&nbsp;
    			<input type="hidden" name="channelId" value="${nConfig.channelId}" id="channelId"/>
    		</#if>
    	</#list>	
    </td>
 	 <td align="center"  width="170">
		<input type="button" class='btn01' value="修改" onclick="goEdit('${nMap}')"/>
	<!--  	<input type="button" class='btn01' value="重置" onclick="goDelete('${nMap}',$('#channelId').attr('value'))"/> -->
		<input type="hidden" name="siteId" value="${siteId}"/>
	</td>
  </tr>
  </#list>
</table>
</form>
</div>
</body>
</html>
